package com.epam.tcs.actions.pages;

public class PageFactory {

	public static Page getPage(String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		
		String classname = "com.epam.tcs.actions.pages." + str.substring(0,1).toUpperCase() + str.substring(1) + "Page";
		
		Object classobject = Class.forName(classname).newInstance();
		
		if (classobject != null) {
			return (Page)classobject;
		}
		
		return null;		
	}
	
}
